// HSS.Net.Dns.Records.RecordA.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       RecordA.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
using System;
/*
 3.4.1. A RDATA format

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |                    ADDRESS                    |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

where:

ADDRESS         A 32 bit Internet address.

Hosts that have multiple Internet addresses will have multiple A
records.
 * 
 */
namespace HSS.Net.Dns.Records
{
	/// <summary>
	/// 
	/// </summary>
	[System.CLSCompliant(false)]
	public class RecordA : Record
	{
		/// <summary>
		/// 
		/// </summary>
		public System.Net.IPAddress Address;
		/// <summary>
		/// 
		/// </summary>
		/// <param name="rr"></param>
		public RecordA(RecordReader rr)
		{
			System.Net.IPAddress.TryParse(string.Format("{0}.{1}.{2}.{3}",
				rr.ReadByte(),
				rr.ReadByte(),
				rr.ReadByte(),
				rr.ReadByte()), out this.Address);
		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public override string ToString()
		{
			return Address.ToString();
		}

	}
}